package com.ibm.dtp.ejb.crud;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

public interface CrudService {
	public <T> T create(T t);

	public <T,ID extends Serializable> T find(Class<T> type, ID id);

	public <T> T update(T t);

	public <T,ID extends Serializable> void delete(Class<T> type, ID id);

	public <T> List<T> findWithNamedQuery(String queryName);

	public <T> List<T> findWithNamedQuery(String queryName, int resultLimit);

	public <T> List<T> findWithNamedQuery(String namedQueryName, Map parameters);

	public <T> List<T> findWithNamedQuery(String namedQueryName, Map parameters,
			int resultLimit);

	public <T> List<T> findByQuery(String query);

	public <T> List<T> findByQuery(String query, int resultLimit);

	public <T> List<T> findByQuery(String query, Map parameters);

	public <T> List<T> findByQuery(String query, Map parameters, int resultLimit);
	
	public <T> List<T> findByDynamicQuery(Class<T> type,List<ParameterDefinition> parameters);

}
